package com.demo.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.demo.common.utils.PageUtils;
import com.demo.common.base.Query;
import com.demo.modules.sys.dao.SysOssDao;
import com.demo.modules.sys.entity.SysOssEntity;
import com.demo.modules.sys.form.SysOssQueryForm;
import com.demo.modules.sys.service.SysOssService;
import org.springframework.stereotype.Service;


@Service("sysOssService")
public class SysOssServiceImpl extends ServiceImpl<SysOssDao, SysOssEntity> implements SysOssService {

	@Override
	public PageUtils<SysOssEntity> queryPage(SysOssQueryForm params) {
		IPage<SysOssEntity> page = this.page(
			new Query<SysOssEntity>().getPage(params),
			new LambdaQueryWrapper<SysOssEntity>()
					.orderByDesc(SysOssEntity::getCreateTime)
		);

		return new PageUtils<>(page);
	}

}
